<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Building Blocks</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
	<table class="tutorial-nav-box">
	<tr>
		<td style="width: 30%">
							<a href="../psYiiExtensions/tutorial_basics.pkg.html" class="nav-button">Previous</a>
					</td>
		<td style="text-align: center">
							<a href="../psYiiExtensions/tutorial_psYiiExtensions.pkg.html" class="nav-button">Up</a>
					</td>
		<td style="text-align: right; width: 30%">
							<span class="nav-button-disabled">Next</span>
					</td>
	</tr>
	<tr>
		<td style="width: 30%">
							<span class="detail">Installation and Configuration</span>
					</td>
		<td style="text-align: center">
							<span class="detail">Pogostick Yii Extension Library</span>
					</td>
		<td style="text-align: right; width: 30%">
					</td>
	</tr>
</table>
	
<div><a name=""></a><div class="ref-title-box"><h1 class="ref-title">Building Blocks</h1></div>
	<div class="ref-synopsis"><span class="author">Jerry Ablan
			<div class="author-blurb"><a href="mailto:yii@pogostick.com">yii@pogostick.com</a></div></span></div>
	<h1 class="title">Table of Contents</h1>
<ul class="toc">
	
			
					<li><a href="../psYiiExtensions/tutorial_components.pkg.html#components">Library Foundation</a></li>
					</ul>

	<span><a name="components"></a><h2 class="title">Library Foundation</h2><p>The basic functionality built into the library is a dynamic variable, or options, system. Using this
		funcationality, one can create options at runtime. These are stored in a way
		that makes it simple to use them as arguments for your own components or third-party ones.</p>
		<p>The second base functionality for the library is enhanced behavior functionality. Behaviors
		attached to the base components can have their own options. In addition, behavior variables may be accessed
		directly by the owner of the behavior with the need for a behavior prefix:</p>
		<p>Without psYiiExtensions...</p>
		<div class="src-code"><ol><li><div class="src-line"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;Create&nbsp;a&nbsp;component&nbsp;and&nbsp;attach&nbsp;a&nbsp;behavior</span></div></li>
<li><div class="src-line"><span class="src-var">$oComp&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id">CComponent</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><span class="src-var">$oComp</span><span class="src-sym">-&gt;</span><span class="src-id">attachBehavior</span><span class="src-sym">(&nbsp;</span><span class="src-str">'myBehavior'</span><span class="src-sym">,&nbsp;</span><span class="src-str">'''x.y.z.behavior'&nbsp;</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;Access&nbsp;a&nbsp;behavior&nbsp;property</span></div></li>
<li><div class="src-line"><span class="src-var">$oComp</span><span class="src-sym">-&gt;</span><span class="src-id">myBehavior</span><span class="src-sym">-&gt;</span><span class="src-id">propertyName</span></div></li>
</ol></div>
		<p>With psYiiExtensions...</p>
		<div class="src-code"><ol><li><div class="src-line"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;Create&nbsp;a&nbsp;component,&nbsp;CPSComponentBehavior&nbsp;is&nbsp;automatically&nbsp;attached</span></div></li>
<li><div class="src-line"><span class="src-var">$oComp&nbsp;</span>=&nbsp;<span class="src-key">new&nbsp;</span><span class="src-id"><a href="../psYiiExtensions/Base/CPSComponent.html">CPSComponent</a></span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
<li><div class="src-line">&nbsp;</div></li>
<li><div class="src-line"><span class="src-comm">//&nbsp;&nbsp;&nbsp;&nbsp;Access&nbsp;CPSComponentBehavior::internalName&nbsp;property</span></div></li>
<li><div class="src-line">echo&nbsp;<span class="src-var">$oComp</span><span class="src-sym">-&gt;</span><span class="src-id">internalName</span><span class="src-sym">;</span></div></li>
</ol></div></span></div>

	<table class="tutorial-nav-box">
	<tr>
		<td style="width: 30%">
							<a href="../psYiiExtensions/tutorial_basics.pkg.html" class="nav-button">Previous</a>
					</td>
		<td style="text-align: center">
							<a href="../psYiiExtensions/tutorial_psYiiExtensions.pkg.html" class="nav-button">Up</a>
					</td>
		<td style="text-align: right; width: 30%">
							<span class="nav-button-disabled">Next</span>
					</td>
	</tr>
	<tr>
		<td style="width: 30%">
							<span class="detail">Installation and Configuration</span>
					</td>
		<td style="text-align: center">
							<span class="detail">Pogostick Yii Extension Library</span>
					</td>
		<td style="text-align: right; width: 30%">
					</td>
	</tr>
</table>
	
	<p class="notes" id="credit">
		Documentation generated on Mon, 15 Jun 2009 22:58:08 -0400 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.2</a>
	</p>
	</div></body>
</html>